package site.codeyin.javautils.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.ParserConfig;

import java.util.List;

/**
 * @author <a href="https://github.com/liangcheng2221">yinjie</a>
 * @date 2024-11-16 23:20
 */
public class JsonUtils {

    private static final ParserConfig SAFE_PARSER_CONFIG;

    static {
        SAFE_PARSER_CONFIG = new ParserConfig();
    }

    public static <T> List<T> fromArray(String json, Class<T> tClass) {
        return JSON.parseObject(json, tClass, SAFE_PARSER_CONFIG);
    }
}
